#include "array_aux.h"
void count_sort(vector<int>& vecA, vector<int>& vecB, int r)
{
	vector<int> vecC;
	for (int i = 1; i <= r; i++)
	{
		vecC.push_back(0);
	}
	for (int j = 1; j <= vecA.size()-1; j++)
	{
		vecC[vecA[j]] = vecC[vecA[j]] + 1;
	}
	for (int k = 2; k <= r; k++)
	{
		vecC[k] = vecC[k] + vecC[k-1];
	}
	for (int p = vecA.size()-1; p >= 1; p--)
	{
		vecB[vecC[vecA[p]]] = vecA[p];
		vecC[vecA[p]] = vecC[vecA[p]] - 1;
	}

}
int main()
{
	
	vector<int> array = get_array(10);
	display_array(array);
	vector<int> result(11, 0);
	count_sort(array , result, 100);
	display_array(result);
	return 0;
}